import { lazy } from 'react'
import { Navigate } from 'react-router-dom'
import Address from '../views/Index/Address'
import Bmap from '../views/Index/Map'
import Pro from '../views/Index/Pro'
import Sub from '../views/Index/Sub'
import Change from '../views/Index/Change'
import Excel from '../views/Index/Excel'
import Banner from '../views/Index/Banner'
import Addbanner from '../views/Index/Addbanner'
import Seckill from '../views/Index/Seckill'
import Command from '../views/Index/Command'
import Search from '../views/Index/Search'
import QxyzGly from './QxyzGly'
var Index = lazy(() => import('../views/Index'))
var Login = lazy(() => import('../views/Login'))
var NotFound = lazy(() => import('../views/NotFound'))

//配置路由表
export default [
    {
        path: '/index',
        element: <Index />,
        children: [

            {
                path: '/index/banner',
                element: <QxyzGly perm='1-1'> <Banner /> </QxyzGly>,
            },
            {
                path: '/index/addbanner',
                element:
                    <Addbanner />,
            },
            {
                path: '/index/address',
                element: <QxyzGly perm='2-1'><Address /></QxyzGly>,
            },
            {
                path: '/index/pro',
                element: <QxyzGly perm='3-1'><Pro /></QxyzGly>,
            }, {
                path: '/index/seckill',
                element: <QxyzGly perm='3-2'><Seckill /></QxyzGly>,
            }, {
                path: '/index/command',
                element: <QxyzGly perm='3-3'><Command /></QxyzGly>,
            }, {
                path: '/index/search',
                element: <QxyzGly perm='3-4'><Search /></QxyzGly>,
            },
            {
                path: '/index/sub',
                element: <QxyzGly perm='4-1'><Sub /></QxyzGly>,
            },
            {
                path: '/index/change',
                element: <QxyzGly perm='5-1'><Change /></QxyzGly>,
            },
            {
                path: '/index/excel',
                element: <QxyzGly perm='6-1'><Excel /></QxyzGly>,
            },
            {
                path: '/index/bmap',
                element: <QxyzGly perm='7-1'><Bmap /></QxyzGly>,
            },
        ]
    },
    {
        path: '/login',
        element: <Login />,
    },
    {
        path: '/',
        element: <Navigate to="/index" />,
    },
    {
        path: '*',
        element: <NotFound />,
    }
]